<template>
  <div class="loading" v-if="show">
    <div class="loading-content">
      <i class="el-icon-loading"></i>
      <p>{{ text }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Loading',
  props: {
    show: {
      type: Boolean,
      default: false
    },
    text: {
      type: String,
      default: '加载中...'
    }
  }
}
</script>

<style scoped>
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.loading-content {
  text-align: center;
}
.loading-content i {
  font-size: 30px;
  color: #409EFF;
}
.loading-content p {
  margin-top: 10px;
  color: #666;
}
</style>